/*-------------------------------------------------------------------------
*************************************************************************
 * @doc SPDH
 * @module spdh.h |  
 *  Header file for SPDH Communication functions.
 *
 * Product     :   SoftPay 2000 (Global Payment Methodology).
 * <nl>Developer   : SoftPay 2000 team  
 * <nl>Notes       :
 *
 * @head3 SPDH Functions |
 * @index | SPDH
 * @end
 *
 * Copyright (c) 1996-2000 by VeriFone Inc. All rights reserved.
 * 
 * No part of this software may be used, stored, compiled, reproduced,
 * modified, transcribed, translated, transmitted, or transferred, in any form 
 * or by any means whether electronic, mechanical, magnetic, optical, 
 * or otherwise, without the express prior written permission of VeriFone, Inc.
 *
 * Revision History
 * ------------------------------------------------------------------------
 $log:  $
 * ------------------------------------------------------------------------
 ********************************************************************************/

#ifndef SPDH_H
#define SPDH_H

#ifdef SPDH_DEFINED

#define LOGOFF          66
#define HANDSHAKE       67

#define MAX_APPROVAL_CODES  (sizeof(inAprvlCodes) / sizeof(inAprvlCodes[0]))
#define MAX_SPDH_FID            44

typedef struct TagSPDH_HEADER
{
	char stDevType[DEV_SIZE];                       /* Device Type      */
	char stTransNo[TRNO_SIZE];                      /* Transmission Num */
	char stTermId[TERM_ID_SIZE];                    /* Terminal Id      */
	char stEmpId[EMP_SIZE];                         /* Employee Id      */
	char stDate[DATE_SIZE];                         /* Current Date     */
	char stTime[TIME_SIZE];                         /* Current Time     */
	char chMsgType;                                 /* Message Type     */
	char chMsgSubType;                              /* Message Subtype  */
	char stTransCode[TRAN_CODE_SIZE];               /* Transaction Code */
	char chProcFlag1;                               /* Processing Flag1 */
	char chProcFlag2;                               /* Processing Flag2 */
	char chProcFlag3;                               /* Processing Flag3 */
	char stRespCode[RESP_SIZE];                     /* Response Code    */
} SPDH_HEADER;

#define SIZE_SPDH_HEADER           sizeof(SPDH_HEADER)

typedef struct TagSPDH_BUFS
{
    char chFID;              /* SPDH FID  */
    char *pchReqBuf;  /* Request Buf for FID  */
    char *pchRspBuf;  /* Response Buf for FID  */
} SPDH_BUFS;

typedef struct TagSPDH_DATA
{
    SPDH_HEADER srHeader;
    SPDH_BUFS srSPDHBufs[MAX_SPDH_FID];
} SPDH_DATA;


#define SIZE_SPDH_DATA      sizeof(SPDH_DATA)
extern SPDH_DATA  srSPDH;                           /* SPDH specific data */

#endif /*SPDH_DEFINED */

#endif /*SPDH_H*/





